using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class AssetAuditMap : EntityTypeConfiguration<AssetAudit>
    {
        public AssetAuditMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Location)
                .IsRequired()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("AssetAudit");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.AssetID).HasColumnName("AssetID");
            this.Property(t => t.Location).HasColumnName("Location");
        }
    }
}
